<?php
$link = new mysqli('localhost', 'root', '654321',
        'shumei19', 3306);
if (!$link) {
    exit('数据库连接失败');
}
$link->set_charset('utf8');

$user_id = 5;
//$sql = 'update users set money = money + 1000 where id = ' . $user_id;
//
//$result = $link->query($sql);
//if ($link->affected_rows > 0) {
//    echo '充值成功';
//} else {
//    echo '充值失败';
//}
$sql = 'delete from users where id = ' . $user_id;
$link->query($sql);
if ($link->affected_rows > 0) {
    echo '删除成功';
} else {
    echo '删除失败';
}
//var_dump($result);
$link->close();
